import { useIntersectionObserver } from "@vueuse/core";
export const lazyLoad = {
    install(app) {
        app.directive("img-lazy", {
            mounted(el,binging) {
                const { stop } = useIntersectionObserver(
                    el,
                    ([{ isIntersecting }]) => {
                        if (isIntersecting) {
                            el.src = binging.value;
                            stop();
                        }
                    }
                );
            },
        });
    }
}